﻿<?php
require_once('../../../config.php');
define('AJAX_SCRIPT', true);
global $DB;

$program_id=$_GET["program"];


//neu dung sql thi phai co mdl_ truoc ten bang, con dung get_record

$sql="SELECT * FROM mdl_major ".
	  " WHERE program_id = '".$program_id."'";
$rs = $DB->get_records_sql($sql);
//addElement("checkbox","chkTest", 'checkbox');
foreach ($rs as $r) {
	echo html_writer::tag('input',"&nbsp;".$r->major_name."&nbsp;&nbsp;&nbsp;", array('type'=>'checkbox','name'=>'major[]', 'value'=>$r->id, 'id'=>'chkmajor')); 
}



?>